var entityCollection = require('../../../Base/server/controllers/EntityCollection'),
	stationWorkController = require('../../../Initialize/server/controllers/StationWork.server.controller');

//根据终端设备UniqueID查找工位对应的工位作业集合
exports.getWorksByTerminalUniqueID = function(terminalUniqueID, completeFun){
	stationWorkController.getStationWorksByTerminalUniqueID(terminalUniqueID, function(err, stationWorkRecords){
		if(err){
			completeFun(err);
		}
		else{
			var works = [];
			for(var i=0; i<stationWorkRecords.length; i++){
				works.push(stationWorkRecords[i].Work);
			}
			completeFun(null, works);
		}
	});
};
